{
    const qSet = {
        '单选': [],
        '多选': [],
        '判断': []
    }

    loop()
    function loop() {
        window.clear = setInterval(() => {
            console.clear()
        }, 1000 * 60)

        window.timer = setInterval(() => {
            check()
        }, 400)
    }

    function check() {
        let wrap = document.querySelector('.content.flex-row-fluid>.card')

        let body = wrap.querySelector('.card-body')
        let btns = wrap.querySelectorAll('.card-footer>.btn.btn-sm-del')

        btns.forEach(e => {
            if (e.innerText == '提交答案') btns.submit = e
            if (e.innerText == '下一题') btns.next = e
        })

        if (!body.querySelector('.mt-5') && !body.querySelector('.is-checked')) {
            // body.querySelector('.d-flex>.el-radio').click()
            body.querySelector('.m-8 label').click()

        } else {
            if (!btns.next) {
                alert('完成')
                console.log(qSet)
                clearInterval(window.timer)
                clearInterval(window.clear)
            }
            if (getQuestion()) {
                if (btns.submit) btns.submit.click()
                btns.next.click()
            }

        }
    }

    function getQuestion() {
        let type = '单选'

        const wrap = document.querySelector('.content.flex-row-fluid>.card')

        // const index = wrap.querySelector('.card-title>.card-label').innerText.split(' ')[1].split('/')[0] - 1
        const body = wrap.querySelector('.card-body')

        {
            let val = body.innerText.split('\n')

            let answer = val.pop().split('：')[1]

            for (let i = 1; i < val.length; i++) {
                val[i] = opt(val[i])
            }

            val.push(answer)

            if (answer == '错误' || answer == '正确') {
                type = '判断'
                val = [val.shift(), val.pop() == '正确' ? 1 : 0]
            } else if (body.querySelector('input[type="checkbox"]')) {
                type = '多选'
            }

            if (!answer) return false

            // qSet[type][index] = val
            qSet[type].push(val)

            console.log(qSet)

            return true
        }

        function opt(str) {
            return str.slice(2, str.length)
        }
    }
}